define([
  'vue',
  ELMP.resource('index.js', 'api'),
  ELMP.resource('components/vxe-table/index.min.js', 'lib'),
  ELMP.resource('utils/index.js', 'lib'),
  ELMP.resource('utils/dayjs.js', 'lib'),
  ELMP.resource('utils/axios.js', 'lib'),
  ELMP.resource('filters/index.js', 'lib'),
  ELMP.resource('components/index.js', 'lib'),
  ELMP.resource('plugins/mixin.js', 'lib'),
  ELMP.resource('plugins/vxe.js', 'lib'),
  ELMP.resource('plugins/treeTool.js', 'lib'),
  ELMP.resource('components/tools/index.js', 'erdcloud_doc'),
  'el-cache',
  ELMP.resource('plugins/lodash.min.js', 'lib'),
  ELMP.resource('plugins/flow/index.js', 'lib'),
  ELMP.resource('utils/validate.js', 'lib'),
  ELMP.resource('plugins/plugs.js', 'lib'),
  ELMP.resource('directives/index.js', 'lib'),
  ELMP.resource('plugins/dayjs/plugin/relativeTime.min.js', 'lib'),
  ELMP.resource('plugins/dayjs/plugin/duration.min.js', 'lib'),
  ELMP.resource('plugins/dayjs/locale/zh-cn.min.js', 'lib'),
], function (
  Vue,
  Api, VXETable, Utils, dayjs,
  axios, filters, components,
  mixin, vxe, treeTool,
  onlyOffice, elCache, lodash,
  flow, validate,plugs,plugins
) {
  'use strict';
  function init() {
    dayjs.locale('zh-cn', zhCn)
    dayjs.extend(relativeTime)
    dayjs.extend(duration)
    $.flow = flow.init()
    $.elApi = Api //全局挂载Api
    $.Utils = Utils //全局挂载自定义方法
    $.dayjs = dayjs //全局挂载时间方法
    $.axios = axios
    $.treeTool = window.treeTool
    $.onlyOffice = onlyOffice
    $.elCache = elCache
    $._ = lodash
    $.elValidate = validate
    $.VXETable = VXETable
    Vue.prototype.$XModal = VXETable.modal
    Vue.prototype.$XPrint = VXETable.print
    Vue.prototype.$XSaveFile = VXETable.saveFile
    Vue.prototype.$XReadFile = VXETable.readFile
    vxe.init(VXETable)
    components.init(Vue)
    Object.keys(filters).forEach(key => {
      Vue.filter(key, filters[key])
    })
    Vue.use(VXETable)
    Vue.use(mixin)

    // 注册通用语言包
    $.i18n.registerCommonLang && $.i18n.registerCommonLang('tmzk_i18n')
  }
  return {
    init: init
  }
});